<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>计算属性的setter和getter</title>
</head>

<body>
    <script src="../js"></script>
    <div id="app">
        <h2>{{fullName}}</h2>
    </div>

    <script>
        var vm = new Vue({
            el: "#app",
            data: {
                msg: 'hello world',
                firstName:"Shane",
                lastName:"He"
            },
            computed:{
                fullName:{
                    get(){
                        return this.firstName+ "" +this.lastName
                    }

            }
            }
        })
    </script>
</body>

</html>